// 联表查询
import { invokeAsyncAPi } from '@/utils/attach'
const SQL = 'SELECT n.*,r.name as ls_name,r.color as ls_color,r.PayLoad7 as todo_color FROM NewRemindItem n inner join RemindMultiList r on n.userId=r.userId AND n.groupId=r.clientId and r.optype<>3'

/**
 * 查询
 * @param {Object} sqlStr
 * @return {Promise}
 */
export async function get (sql, order = '') {
  const sqlStr = `${SQL} where ${sql} GROUP BY n.id,r.clientId ${order}`
  // console.log(sqlStr)
  const result = await invokeAsyncAPi('remind_query', sqlStr)
  return result || []
}
